<!--双向转诊药店订单查询-->
<template>
  <div class="detail">
    <div class="detail-item">
      <p class="detail-item-tle">购买信息</p>
      <div class="detail-item-com">
        <p style="font-size: 16px; color: #F56C6C">{{ dianzhidatesc.status | format }}</p>
        <p>订单编号：{{ dianzhidatesc.orderNum ? dianzhidatesc.orderNum : '暂无订单编号' }}</p>
        <p>购买时间：{{ dianzhidatesc.createTime ? dianzhidatesc.createTime : '暂无购买时间' }}</p>
        <p>订单类型：{{ dianzhidatesc.lectureType === 0 ? '直播' : '点播' }}</p>
        <p>用户昵称：{{ dianzhidatesc.memberName ? dianzhidatesc.memberName : '暂无用户昵称' }}</p>
        <p>购买金额：{{ dianzhidatesc.cost ? dianzhidatesc.cost : '暂无购买金额' }}</p>
      </div>
    </div>
    <div class="detail-item">
      <p class="detail-item-tle">{{ dianzhidatesc.lectureType === 0 ? '直播信息' : '点播信息' }}</p>
      <div class="detail-item-com">
        <p>{{ dianzhidatesc.lectureType === 0 ? '直播' : '点播' }}标题：{{ dates.title }}</p>
        <p>{{ dianzhidatesc.lectureType === 0 ? '直播时间' : '发布时间' }}：{{ dianzhidatesc.createTime }}</p>
        <p>{{ dianzhidatesc.lectureType === 0 ? '直播医生' : '点播医生' }}：{{ dates.doctorName }} {{ dates.deptName }} {{ dates.hospitalName }}</p>
        <p>讲堂类型：{{ dates.title }}</p>
      </div>
    </div>
    <div style="width: 100%;height: 35px;text-align: center;margin-top:20px">
      <Button  style="width: 100px;height: 35px;line-height: 0;margin: auto;" @click="handleGOback">
        <i class = "iconfont icon-butongyi" style="font-size:14px;margin-right:5px"></i>返回
      </Button>
    </div>
  </div>
</template>

<script>
import api from "@/api/commonApi";
export default {
  name: 'detail',
  data() {
    return {
      lectureType: localStorage.getItem('lectureType'),
      id: this.$route.params.id,
      dates: {},
      dianzhidatesc: {}
    }
  },
  mounted() {
    this.dianzhidatesc = JSON.parse(localStorage.getItem('dianzhidatesc'))
    this.gethomecode()
  },
  beforeDestroy() {
    localStorage.removeItem('dianzhidatesc')
  },
  methods: {
    gethomecode() {
      let reqData = {
        demandId: this.id
      }
      this.$axios.post(api.managementfindLectureDetail, reqData).then(res => {
        console.log(res.data)
        this.dates = res.data
      });
    },
    handleGOback() {
      this.$router.back()
    }
  },
  filters: {
    format(val) {
      switch (parseInt(val)) {
        case 0:
          return '已购买'
        case 1:
          return '运营审核'
        case 2:
          return '已退费'
        case 3:
          return '审核中'
      }
    }
  }
}
</script>

<style lang="less" scoped>
  .detail{
    width: 98%;
    margin: auto;
    // padding-top: 10px;
    .detail-item{
      width: 100%;
      min-height: 150px;
      border: 1px solid #dddddd;
      background-color: white;
      .detail-item-tle{
        width: 100%;
        margin: auto;
        height: 40px;
        line-height: 40px;
        text-indent: 15px;
        color: #fff;
        background-image: linear-gradient(to right, #07a6a5 , #fff);
        border-color: #ddd;
        font-size: 14px;
        font-weight: 550;
      }
      .detail-item-com{
        width: 96%;
        margin: auto;
        font-size: 13px;
        color: #676a6c;
        padding: 15px 0;
        line-height: 22px;
        padding-bottom: 20px;
        .img-bor{
          width: 100%;
          border: 1px solid #ddd;
          display: flex;
          flex-flow: row wrap;
          justify-content: flex-start;
        }
      }
    }
  }
</style>
